package com.s10.ecloud.web.model;

// default package

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "LOG", catalog = "ECLOUD")
public class Log implements java.io.Serializable {

	private static final long serialVersionUID = 1L;

	private Integer id;
	private SystemUser user;
	private SystemUser vendor;
	private Device equipment;
	private Device equipmentvendor;
	private Command command;
	private DeviceType devicetype;
	private Date logtime;
	// 0�豸���� 1�豸��� 2�豸ά����
	private String logevent;
	public int count;
	public String parttime;

	// Constructors

	/** default constructor */
	public Log() {
	}

	/** full constructor */
	public Log(SystemUser user, Device equipment, Date logtime, String logevent) {
		this.user = user;
		this.equipment = equipment;
		this.logtime = logtime;
		this.logevent = logevent;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userid")
	public SystemUser getUser() {
		return this.user;
	}

	public void setUser(SystemUser user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "euqipid")
	public Device getEquipment() {
		return this.equipment;
	}

	public void setEquipment(Device equipment) {
		this.equipment = equipment;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "euqipidvendor")
	public Device getEquipmentvendor() {
		return equipmentvendor;
	}

	public void setEquipmentvendor(Device equipmentVendor) {
		this.equipmentvendor = equipmentVendor;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "logtime", length = 0)
	public Date getLogtime() {
		return this.logtime;
	}

	public void setLogtime(Date logtime) {
		this.logtime = logtime;
	}

	@Column(name = "logevent", length = 1)
	public String getLogevent() {
		return this.logevent;
	}

	public void setLogevent(String logevent) {
		this.logevent = logevent;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "commandid")
	public Command getCommand() {
		return command;
	}

	public void setCommand(Command command) {
		this.command = command;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "vendorid")
	public SystemUser getVendor() {
		return vendor;
	}

	public void setVendor(SystemUser vendor) {
		this.vendor = vendor;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "devicetype")
	public DeviceType getDevicetype() {
		return devicetype;
	}

	public void setDevicetype(DeviceType devicetype) {
		this.devicetype = devicetype;
	}

}